package com.model;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;


@Entity
public class Photo {
	
	private Integer id;
	private String token;
	private String title;
	private String picurl;
	private boolean isshoinfo;
	private Integer num;
	private boolean status;
	private String createTime;
	private String info;
	private Keyword keyword;
	private Set<PhotoList> photolist;
	
	@OneToMany(mappedBy="photo",fetch=FetchType.LAZY,cascade=CascadeType.REMOVE)
	public Set<PhotoList> getPhotolist() {
		return photolist;
	}
	public void setPhotolist(Set<PhotoList> photolist) {
		this.photolist = photolist;
	}
	@Id
	@GeneratedValue
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getToken() {
		return token;
	}
	public void setToken(String token) {
		this.token = token;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getPicurl() {
		return picurl;
	}
	public void setPicurl(String picurl) {
		this.picurl = picurl;
	}
	public boolean isIsshoinfo() {
		return isshoinfo;
	}
	public void setIsshoinfo(boolean isshoinfo) {
		this.isshoinfo = isshoinfo;
	}
	public Integer getNum() {
		return num;
	}
	public void setNum(Integer num) {
		this.num = num;
	}
	public boolean isStatus() {
		return status;
	}
	public void setStatus(boolean status) {
		this.status = status;
	}
	public String getCreateTime() {
		return createTime;
	}
	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}
	public String getInfo() {
		return info;
	}
	public void setInfo(String info) {
		this.info = info;
	}
	
	@OneToOne
	@JoinColumn(name="keyid",insertable=true,unique=true)
	public Keyword getKeyword() {
		return keyword;
	}
	public void setKeyword(Keyword keyword) {
		this.keyword = keyword;
	}
}
